@extends('admin._layouts.default')

@section('main')

        <div class="row-fluid">
            @include('admin._partials.order_top')

            <!-- 搭配方案开始 -->
              <hr>
              <h3><span><i class="fa fa-align-justify"></i> 搭配方案</span></h3>
              <div>
                <!-- 历史沟通信息开始 -->
              @foreach($collocations as $collocation)
              <?php $plans = (array)json_decode($collocation->plan); ?>
              <div class="form-row control-group row-fluid">
                <div class="controls span1">
                    <img src="{{ asset('web/img/logo_avatar.gif') }}" class="img-thumbnail">
                </div>
                <div class="controls span10">
                  <blockquote>
                    <p>
                    @foreach($plans['content'] as $key => $plan)
                    @if($plan != '')
                    <span class="mg5"><i class="fa fa-tag"></i> {{ $plan }} <i class="fa fa-cny"></i>{{ $plans['price'][$key] }}</span>
                    @endif
                    @endforeach
                    </p>
                    <p><i class="fa fa-edit"></i> {{ $collocation->remark }} </p>
                    <footer>{{ $collocation->created_at }}</footer>
                  </blockquote>
                </div>
              </div>
              @if($collocation->reback != '')
              <div class="form-row control-group row-fluid">
                <div class="controls span1">
                    <img src="{{ $customer->avatar }}" class="img-thumbnail">
                </div>
                <div class="controls span10">
                  <blockquote class="blockquote-reverse">
                    <p><i class="fa fa-edit"></i> {{ $collocation->reback }}</p>
                    <footer>{{ $collocation->updated_at }}</footer>
                  </blockquote>
                </div>
              </div>
              @endif
              @endforeach

              <hr class="border_das">
             <!-- 历史沟通信息结束 -->
                        {{ Form::open(array('route' => 'admin.collocations.store','id'=>'form_new')) }}
                        <input type="hidden" name="order_id" value="{{ $order->id }}">
                        <input type="hidden" name="order_status" value="1">
                        <!-- 第一条方案开始 -->
                          <div class="form-row control-group row-fluid">
                            <div class="controls span7">
                              <div class="input-prepend row-fluid">
                                <span class="add-on prepend "><i class="fa fa-tag"></i></span>
                                <input class="row-fluid" name="content[]" id="cloth1" required  size="50" type="text" placeholder="请描述一款服饰，如全棉白色长袖衬衫">
                              </div>
                            </div>
                            <div class="controls span3">
                              <div class="input-prepend input-append row-fluid">
                                <span class="add-on prepend "><i class="fa fa-cny"></i></span>
                                <input class="row-fluid" name="price[]" id="price1" required  size="6" type="text">
                                <span class="add-on ">.00</span>
                              </div>
                            </div>
                            <div class="controls span2">
                              <a href="javascript:void (0)" onclick="insert()" class="btn btn-primary" rel="tooltip" data-placement="left" data-original-title="新增一条"><i class="fa  fa-plus"></i></a><!-- 第一条不能删 -->
                            </div>
                          </div>
                        <!-- 第一条方案结束 -->
                        <!-- 新增一条方案开始 -->
                        <div id="to_copy" style="display: none;">
                          <div class="form-row control-group row-fluid">
                            <div class="controls span7">
                              <div class="input-prepend row-fluid">
                                <span class="add-on prepend "><i class="fa fa-tag"></i></span>
                                <input class="row-fluid" name="content[]" id="cloth2" required  size="50" type="text" placeholder="请描述一款服饰，如全棉白色长袖衬衫">
                              </div>
                            </div>
                            <div class="controls span3">
                              <div class="input-prepend input-append row-fluid">
                                <span class="add-on prepend "><i class="fa fa-cny"></i></span>
                                <input class="row-fluid" name="price[]" id="price2" required  size="6" type="text">
                                <span class="add-on ">.00</span>
                              </div>
                            </div>
                            <div class="controls span2">
                              <button  onclick="deletes(this)"  class="btn btn-inverse" rel="tooltip" data-placement="left" data-original-title="删除本条"><i class="fa  fa-trash" ></i></button>
                            </div>
                          </div>
                          </div>
                        <!-- 新增一条方案结束 -->
                        <!-- 说明开始 -->
                          <div class="form-row control-group row-fluid">
                            <div class="controls span7">
                              <textarea rows="3" name="remark" class="row-fluid autogrow" id="elastic-textarea" placeholder="说明一下搭配思路.."></textarea>
                            </div>
                          </div>
                        <!-- 说明结束 -->
                          <div class="form-actions row-fluid">
                            <div class="span5 offset3">
                              <button type="submit" class="btn btn-primary"  onclick="sub()"><i class="fa fa-paper-plane"></i> 发给客户</button>
                              <a class="btn btn-secondary" href="#" data-toggle="modal" data-target="#decline"><i class="fa fa-frown-o"></i> 需求较复杂无法满足</a>
                              <!-- 无法满足确认开始 -->
                              <div id="decline" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" >
                                  <div class="modal-dialog modal-sm">
                                      <div class="modal-content">
                                          <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                            <h3 class="modal-title" id="declineLabel">请说明下拒绝理由吧</h3>
                                          </div>
                                          <div class="modal-body">
                                              <textarea rows="3" class="row-fluid autogrow" id="declinereson">您的需求中部分内容我们无法帮您解决，期待与您的再次沟通！</textarea>
                                          </div>
                                          <div class="modal-footer">
                                          <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                          <button type="button" class="btn btn-primary"><i class="fa fa-paper-plane-o"></i> 确定</button>
                                          </div>
                                      </div>
                                    </div>
                                </div>
                              <!-- 无法满足确认结束 -->
                            </div>
                          </div>
                {{ Form::close() }}



            </div> <!-- End .content -->
          </div><!-- End .span9 -->
        </div><!-- End .row-fluid -->

@stop

@section('script')
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/jquery.peity.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/jquery.uniform.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/chosen/chosen/chosen.jquery.min.js') }}"></script>

<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/plugins/flot/jquery.flot.js') }}"></script>



<script src="{{ URL::asset('web/js/scripts.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ URL::asset('web/js/jnavigate.jquery.min.js') }}"></script>

<script>
function insert(){
    var copy = $('#to_copy');
    var html = copy.html();
    copy.before(html);

}
function deletes(obj){
        $(obj).parent().parent().remove();

}
function sub(){
    $('#form_new').submit();
}
</script>
@stop
